import {instance} from '@/http/instance';

/**
 * 删除表单
 * @param {Number} formId 表单id
 * @return {AxiosPromise} promise
 */
const deleteForm = (formId) => {
    return instance({
        url: `/form/${formId}`,
        method: 'delete',
    });
};
/**
 * 获取当前登陆用户的表单
 * @return {AxiosPromise} promise
 */
const getFormList = () =>{
    return instance({
        url: '/user/form',
        method: 'get',
    });
};

const searchUser = (userName) =>{
    return instance({
        url: `/user/search?userName=${userName}`,
        method: 'get',
    });
};
export default {
    deleteForm,
    getFormList,
    searchUser,
};
